/*************************************************************************************
  Copyright (C) 2014 Laboratori de Gràfics i Imatge, Universitat de Girona &
  Institut de Diagnòstic per la Imatge.
  Girona 2014. All rights reserved.
  http://starviewer.udg.edu

  This file is part of the Starviewer (Medical Imaging Software) open source project.
  It is subject to the license terms in the LICENSE file found in the top-level
  directory of this distribution and at http://starviewer.udg.edu/license. No part of
  the Starviewer (Medical Imaging Software) open source project, including this file,
  may be copied, modified, propagated, or distributed except according to the
  terms contained in the LICENSE file.
 *************************************************************************************/

#include "diagnosistestresult.h"

namespace udg {

DiagnosisTestResult::DiagnosisTestResult()
{
}

DiagnosisTestResult::~DiagnosisTestResult()
{

}

DiagnosisTestResult::DiagnosisTestResultState DiagnosisTestResult::getState() const
{
    if (!m_errors.isEmpty())
    {
        return DiagnosisTestResult::Error;
    }
    else if (!m_warnings.isEmpty())
    {
        return DiagnosisTestResult::Warning;
    }
    else
    {
        return DiagnosisTestResult::Ok;
    }
}

void DiagnosisTestResult::addError(const DiagnosisTestProblem &problem)
{
    m_errors.append(problem);
}

void DiagnosisTestResult::addWarning(const DiagnosisTestProblem &problem)
{
    m_warnings.append(problem);
}

QList<DiagnosisTestProblem> DiagnosisTestResult::getErrors() const
{
    return m_errors;
}

QList<DiagnosisTestProblem> DiagnosisTestResult::getWarnings() const
{
    return m_warnings;
}

}
